package com.linx.common.translation.core.impl;


import com.linx.common.core.service.ParkService;
import com.linx.common.translation.annotation.TranslationType;
import com.linx.common.translation.constant.TransConstant;
import com.linx.common.translation.core.TranslationInterface;
import lombok.AllArgsConstructor;

@AllArgsConstructor
@TranslationType(type = TransConstant.PARK_ID_TO_NAME)
public class ParkNameTranslationImpl implements TranslationInterface<String> {

    private final ParkService parkService;

    @Override
    public String translation(Object key, Object key2, String other, Class<?> clazz) {
        if (key == null || key.toString().isEmpty()) {
            return null;
        }

        return parkService.getParkNameById(Long.valueOf((String) key));
    }
}
